package com.example.design.a.factory;

import com.example.design.a.factory.domain.car.BenzCar;
import com.example.design.a.factory.domain.Product;
import com.example.design.a.factory.domain.ProductTypeEnum;

/**
 * 奔驰汽车生产工厂
 */
public class BenzFactory extends AbstractFactory {

    @Override
    public Product build(ProductTypeEnum productType) {
        if (productType == null) {
            return null;
        }
        switch (productType) {
            case BENZ_C200L:
                return new BenzCar(productType.getProType(), "white");
            case BENZ_S300:
                return new BenzCar(productType.getProType(), "black");
        }
        return null;
    }
}
